import Vue from 'vue'
import VueRouter from 'vue-router'
// 公共页面
import main from '../views/Layout/main.vue'

// 系统端
import adminHome from '../views/Home/adminHome.vue'
import companyManage from '../views/Manage/companyManage.vue'
import cusUserManage from '../views/Manage/cusUserManage.vue'
import sysUserManage from '../views/Manage/sysUserManage.vue'
import labelManage from '../views/Manage/labelManage.vue'
import sysUserInfoManage from '../views/Manage/sysUserInfoManage.vue'
import informationCharts from '../views/DataStatistics/informationCharts.vue'

Vue.use(VueRouter)

const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
    return originalPush.call(this, location).catch(err => err)
}
export const routes = [
    // 系统端
    {
        path: '/',
        name: 'Main',
        component: main,
        children: [
          {
            path: '/',
            name: "adminHome",
            label: "首页",
            icon: "s-home",
            component: adminHome,
          },
          {
            path: '/Home',
            name: "companyManage",
            label: "家政公司管理",
            icon: "s-order",
            component: companyManage,
          },
          {
            path: '/cusUserManage',
            name: "cusUserManage",
            label: "顾客用户管理",
            icon: "s-order",
            component: cusUserManage,
          },
          {
            path: '/sysUserManage',
            name: "sysUserManage",
            label: "系统用户管理",
            icon: "s-order",
            component: sysUserManage,
          },
          {
            path: '/labelManage',
            name: "labelManage",
            label: "服务标签管理",
            icon: "s-order",
            component: labelManage,
          },
          // {
          //   path: '/informationCharts',
          //   name: "informationCharts",
          //   label: "数据统计",
          //   icon: "s-order",
          //   component: informationCharts,
          // },
          {
            path: '/sysUserInfoManage',
            name: "sysUserInfoManage",
            label: "个人信息管理",
            icon: "s-order",
            component: sysUserInfoManage,
          },
        ]
      },
]

export const asyncRoutes = [

]

const router = new VueRouter({
    routes
})

export default router